<?php
 use think\facade\Route;

 function AdminRoute(){

     Route::get('/', 'Auth/login');
     // 登录页
     Route::get('/login', 'Auth/login');
     // 注册页
     Route::get('/register', 'Auth/register');
     // 后台
     Route::get('/home/index', 'Auth/index')->middleware('AuthLogin');
     // 首页
     Route::get('/home/welcome', 'Auth/welcome')->middleware('AuthLogin');
     // 空白页
     Route::get('/error', 'Auth/error');

     // 执行登录
     Route::post('/doLogin', 'Auth/doLogin');
     // 执行注册
     Route::post('/doRegister', 'Auth/doRegister');



     // 个人信息
     // group第一个参数控制路由前缀，  prefix是同一个控制器的前缀
     Route::group('users', function () {
         Route::get('/detail', 'detail');
         Route::get('/doSubmitDetail', 'doSubmitDetail');
         Route::get('/update', 'update');
         Route::get('/doSubmitUpdate', 'doSubmitUpdate');
     })->prefix('Users/')->middleware('AuthLogin');

     // 用户管理
     Route::group('user_manage', function () {
         Route::get('/edit', 'edit');
         Route::get('/list', 'list');
         Route::get('/select', 'select');
     })->prefix('UserManage/')->middleware('AuthLogin');


     // 商品管理
     Route::group('goods_manage', function () {
         Route::get('/upload', 'upload');
         Route::get('/step', 'step');
     })->prefix('GoodsManage/')->middleware('AuthLogin');


     // 其它
     Route::group('other', function () {
         Route::get('/menu', 'menu');
         Route::get('/setting', 'setting');
     })->prefix('Other/')->middleware('AuthLogin');

 }